// Copyright [2020] <unknown>
#include <bits/stdc++.h>
using namespace std;
// #define ONLINE_JUDGE
#ifndef ONLINE_JUDGE
#define dbg(x...) { cerr << "\033[32;1m" << #x << " -> "; err(x); }
void err() { cerr << "\033[39;0m" << endl; }
template<typename T, typename... A>
void err(T a, A... x) { cerr << a << ' '; err(x...); }
#else
#define dbg(...)
#endif

#define sz(x) ((int)x.size())

typedef long long LL;

int t, n;

const int N = 4e5+50, M = 25;

int a[N];

int solve(int k) {
    static int b[N];
    int mask = (1 << k) - 1;

    LL cnt = 0;
    int c[] = {0, 0};

    for (int i=0; i<n; ++i) {
        int id = (a[i] >> k) & 1;
        cnt += c[id ^ 1];
        c[id]++;
    }

    for (int i=0; i<n; ++i) {
        b[i] = a[i] & mask;
    }
    int r = 0;
    sort(b, b+n);
    int tv = 1 << k;
    // for (int i=0; i<n; ++i)
    //     dbg(i, b[i]);
    for (int i=0; i<n; ++i) {
        r = max(r, i+1);
        while (r < n && b[r] + b[i] < tv)
            ++r;
        while (r-1 > i && b[r-1] + b[i] >= tv)
            --r;
        cnt += n - r;
        // dbg(i, r);
    }
    dbg(cnt, k, mask);
    if (cnt & 1)
        return tv;
    else
        return 0;
}


int main(int argc, char const *argv[]) {
    // code
    scanf("%d", &n);
    for (int i=0; i<n; ++i)
        scanf("%d", &a[i]);
    LL ans = 0;
    for (int i=0; i<M; ++i)
        ans += solve(i);
    cout << ans << endl;
    
    return 0;
}
